<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<script src="layui/layui.js"></script>
<body>
<header class="header style7">
	
			<div class="top-bar">
				<div class="container">
					<div class="top-bar-left">
						<div class="header-message">
							欢迎来一片绿叶网上盆栽商店！
						</div>
					</div>
					<div class="top-bar-right">
						<div class="header-language">
							<div class="teamo-language teamo-dropdown">
								<a href="#" class="active language-toggle" data-teamo="teamo-dropdown">
									<span>
										中文（￥）
									</span>
								</a>
								<ul class="teamo-submenu">
									<li class="switcher-option">
										<a href="#">
											<span>
												英语 ($)
											</span>
										</a>
									</li>
									<li class="switcher-option">
										<a href="#">
											<span>
												法语(€)
											</span>
										</a>
									</li>
								</ul>
							</div>
						</div>
						
						<ul class="header-user-links">
						<c:choose>
						   <c:when test="${!empty sessionScope.vipInfo.vName}">
						   <li>您好！欢迎${sessionScope.vipInfo.vName}来到一片绿叶
						   <a href="#" onclick="loginOut()">退出登录</a></li>
							</c:when>
							<c:otherwise>
							<li><a href="login.jsp">登录或注册</a></li>
							</c:otherwise>
						</c:choose>
						</ul>
						
					</div>
				</div>
			</div>
			<div class="container">
				<div class="main-header">
					<div class="row">
						<div class="col-lg-3 col-sm-4 col-md-3 col-xs-7 col-ts-12 header-element">
							<div class="logo">
								<a href="index.jsp">
									<img src="images/logo.png" alt="img">
								</a>
							</div>
						</div>
						<div class="col-lg-7 col-sm-8 col-md-6 col-xs-5 col-ts-12">
							<div class="block-search-block">
								<form class="form-search form-search-width-category">
									<div class="form-content">
										<div class="category">
										</div>
										<div class="inner">
											<input type="text" class="input" name="s" value="" placeholder="查找你的宝贝">
										</div>
										<button class="btn-search" type="submit">
											<span class="icon-search"></span>
										</button>
									</div>
								</form>
							</div>
						</div>
						<div class="col-lg-2 col-sm-12 col-md-3 col-xs-12 col-ts-12">
							<div class="header-control">
								<div class="block-minicart teamo-mini-cart block-header teamo-dropdown">
									<a href="javascript:void(0);" onclick="getCart()" class="shopcart-icon" data-teamo="teamo-dropdown">
										Cart
									</a>
									
									
								</div>
								<div class="block-account block-header teamo-dropdown">
									<a href="javascript:void(0);" onclick="getUser()" data-teamo="teamo-dropdown">
										<span class="flaticon-user"></span>
									</a>
								</div>
								<a class="menu-bar mobile-navigation menu-toggle" href="#">
									<span></span>
									<span></span>
									<span></span>
								</a>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="header-nav-container rows-space-20">
				<div class="container">
					<div class="header-nav-wapper main-menu-wapper">
						<div class="vertical-wapper block-nav-categori">
							<div class="block-title">
								<span class="icon-bar">
									<span></span>
									<span></span>
									<span></span>
								</span>
								<span class="text">所有分类</span>
							</div>
							<div class="block-content verticalmenu-content">
								<ul class="teamo-nav-vertical vertical-menu teamo-clone-mobile-menu">
									<li class="menu-item">
										<a href="#" class="teamo-menu-item-title" title="New Arrivals">新品尝鲜</a>
									</li>
									<li class="menu-item">
										<a title="Hot Sale" href="#" class="teamo-menu-item-title">热销</a>
									</li>

									<li class="menu-item">
										<a title="Ferns" href="#" class="teamo-menu-item-title">蕨类植物</a>
									</li>
									<li class="menu-item">
										<a title="Hanging plants" href="#" class="teamo-menu-item-title">悬挂植物</a>
									</li>
								</ul>
							</div>
						</div>
						<div class="header-nav">
							<div class="container-wapper">
								<ul class="teamo-clone-mobile-menu teamo-nav main-menu " id="menu-main-menu">
									<li class="menu-item">
										<a href="index.jsp" class="teamo-menu-item-title" title="Home">首页</a>
										<span class="toggle-submenu"></span>
									</li>
									<li class="menu-item">
										<a href="gridproducts_leftsidebar.jsp" class="teamo-menu-item-title"
											title="Shop">商城</a>
									</li>
									<li class="menu-item  menu-item-has-children item-megamenu">
										<a href="#" class="teamo-menu-item-title" title="Pages">快捷导航</a>
										<span class="toggle-submenu"></span>
										<div class="submenu mega-menu menu-page">
											<div class="row">
												<div class="col-xs-12 col-sm-12 col-md-12 col-lg-3 menu-page-item">
													<div class="teamo-custommenu default">
														<h2 class="widgettitle">购物页面</h2>
														<ul class="menu">
															<li class="menu-item">
																<a onclick="getCart()">购物车</a>
															</li>
															<li class="menu-item">
																<a href="checkout.jsp">收款</a>
															</li>
															<li class="menu-item">
																<a href="contact.jsp">联系我们</a>
															</li>
															<li class="menu-item">
																<a href="login.jsp">登录/注册</a>
															</li>
														</ul>
													</div>
												</div>
												<div class="col-xs-12 col-sm-12 col-md-12 col-lg-3 menu-page-item">
													<div class="teamo-custommenu default">
														<h2 class="widgettitle">商城页面</h2>
														<ul class="menu">
															<li class="menu-item">
																<a href="gridproducts_leftsidebar.jsp">所有商品</a>
															</li>
														</ul>
													</div>
												</div>
												<div class="col-xs-12 col-sm-12 col-md-12 col-lg-3 menu-page-item">
												</div>
												<div class="col-xs-12 col-sm-12 col-md-12 col-lg-3 menu-page-item">
												</div>
											</div>
										</div>
									</li>
									<li class="menu-item">
										<a href="bloglist-leftsidebar.jsp" class="teamo-menu-item-title"
											title="Blogs">资讯</a>
											<!-- <li class="menu-item menu-item-has-children">
												<a href="inblog_right-siderbar.jsp" class="teamo-menu-item-title"
													title="Post Layout">按帖子查看</a>
												<span class="toggle-submenu"></span>

											</li> -->
										
									</li>
									<li class="menu-item">
										<a href="about.jsp" class="teamo-menu-item-title" title="About">关于我们</a>
									</li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
			
		</header>
</body>
<script type="text/javascript">
function loginOut(){
		$.post('http://localhost:8080/Greenleaf/vip/loginOut', //登录
				function(res){
			alert("退出成功！");
			window.location.href="login.jsp";
		},"text"
		)
		
}
function getCart(){
	  var vip='${sessionScope.vipInfo}';
	   if(vip==null || vip=='' ||vip==undefined){
	     layer.msg("请先登录！");
	     return false;
	   }else{
		   window.location.href="shoppingcart.jsp";
	   }
}

function getUser(){
	 var vip='${sessionScope.vipInfo}';
	   if(vip==null || vip=='' ||vip==undefined){
	     layer.msg("请先登录！");
	     return false;
	   }else{
		   window.location.href="personal.jsp";
	   }
}
</script>
</html>